package com.tn.exam.service;

import java.io.Serializable;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.tn.exam.dao.InfoSysUserDao;
import com.tn.exam.entity.InfoSysUser;
import com.tn.exam.help.orm.Page;
import com.tn.exam.help.orm.PropertyFilter;

@Component
public class UserService extends BaseService{
	private InfoSysUserDao infoSysUserDao;

	@Resource
	public void setInfoSysUserDao(InfoSysUserDao infoSysUserDao) {
		this.infoSysUserDao = infoSysUserDao;
	}
	
	public List getAll(){
		log.info("getAll()");
		return infoSysUserDao.getAll();
	}
	
	public int getAllTotal(){
		log.info("getAllTotal()");
		return infoSysUserDao.getAllTotal();
	}
	
	public InfoSysUser getEntity(Serializable id){
		return (InfoSysUser) infoSysUserDao.get(id);
	}

	public void pageQuery(Page page) {
		List list = infoSysUserDao.queryForPage((page.getPageNo() - 1) * page.getPageSize(), page.getPageNo() * page.getPageSize());
		page.setResult(list);
	}

	public InfoSysUser getSysUser(String username) {
		return  (InfoSysUser) infoSysUserDao.getUniqueByProperty("sysUserName", username.trim());
	}

	
}
